﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link href="__STATIC__admin/css/admin-min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__STATIC__admin/css/admin.css" />
<link href="__STATIC__admin/iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__STATIC__admin/css/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__admin/css/skin/default/skin.css" id="skin" />
<link href="__STATIC__admin/css/admin-style.css" rel="stylesheet" type="text/css" />

<title>资讯管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span>
	资讯管理
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container container">

	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
			<a class="btn btn-primary radius" href="<?php echo U('admin/news/add');?>"><i class="Hui-iconfont"></i> 添加资讯</a>
			<a class="btn btn-primary radius" id ='pass-more' data-href="<?php echo U('admin/news/pass');?>"><i class="Hui-iconfont">&#xe6e1;</i> 批量审核</a>
			<a class="btn btn-primary radius" id ='del-more' data-href="<?php echo U('admin/news/del');?>"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>


		</span>
		<span class="r">共有数据：<strong><?php echo $data['count'];?></strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th aria-label="" style="width: 25px;" colspan="1" rowspan="1" class="sorting_disabled" width="25"><input name="" value="" type="checkbox"></th>
					<th width="70">ID</th>
					<th width="80">标题</th>
					<th width="200">状态</th>
					<th width="200">置顶性质</th>
					<th>发布时间</th>
					<th>点击量</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
			<?php foreach($data['data'] as $k => $v){ ?>
				<tr class="text-c">
					<td><input value="<?php echo $v['id'];?>" name="id" type="checkbox"></td>
					<td><?php echo $v['id'];?></td>
					<td><a href="{:U('news/news/index',array('id'=>$v['id']))}" target="_blank"><?php echo $v['title'];?></a></td>
					<td><?php if($v['status'] == 0){ echo '待审核';}else if($v['status'] == 1){ echo '已通过';}else if($v['status'] == 2){echo '未通过';}?></td>
					<td><?php if($v['type'] == 0){ echo '默认排序';}else if($v['type'] == 1){ echo '置顶';}else if($v['type'] == 2){ echo '广告';}?></td>

					<td><?php echo $v['create_time'];?></td>
					<td><?php echo $v['click'];?></td>

					<td class="f-14 product-brand-manage">
						<a style="text-decoration:none"  href="<?php echo U('admin/news/edit',array('id'=>$v['id'])); ?>" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
						<a style="text-decoration:none"  href="<?php echo U('admin/news/pass',array('id'=>$v['id'])); ?>" title="审核"><i class="Hui-iconfont">&#xe6a7;</i></a>
						<a style="text-decoration:none" class="ml-5"  href="<?php echo U('admin/news/del',array('id'=>$v['id'])); ?>" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
					</td>
				</tr>
			<?php } ?>
			</tbody>
		</table>
	</div>
	{$page}
</div>

<script type="text/javascript" src="__STATIC__admin/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__admin/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__admin/js/admin-admin.js"></script>
<script>
	$(function(){
		$('#pass-more').click(function(){
			goto($(this))
		})
		$('#top-more').click(function(){
			goto($(this))
		})
		$('#del-more').click(function(){
			goto($(this))
		})
		function goto(obj){
			var id = getCheckedId();
			var url = obj.attr('data-href');
			location.href = url + "&id=" + id ;
		}
		function getCheckedId(){
			var id = '';
			$('input[name="id"]:checked').each(function(){
				var value = $(this).val();
				id += value +',';
			});
			return id;
		}
		//批量删除
	})
</script>
</body>
</html>